﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Masters/AdminMasterPage.master"
    AutoEventWireup="true" CodeFile="OrderSoftDetails.aspx.cs" Inherits="Admin_OrderSoftDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="content-box">
        <!-- Start Content Box -->
        <div class="content-box-header">
            <h3>
                Thông tin phiếu đặt hàng</h3>
            <ul class="content-box-tabs">
                <li><a href="#tab1" class="default-tab">Phiếu đặt hàng</a></li>
            </ul>
            <div class="clear">
            </div>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
           
            <input type="hidden" name="act" id="act" value="update" />
            <!-- Start Tab Danh Sach-->
            <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <!-- Start Notification -->
                <div id="NotificationMessage" runat="server">
                </div>
                <!-- End Notification -->
                <table width="100%" align="center">
                    <thead>
                    </thead>
                    <tfoot>
                        <tr>
                            <td>
                                <div class="bulk-actions align-left">
                                    <asp:Button ID="btnDuyetPhieu" runat="server" CssClass="button" OnClick="btnDuyetPhieu_Click"
                                        Text="Duyệt phiếu đặt hàng" Visible="False" />
                                    <asp:Button ID="btnYeuCauThanhToan" runat="server" CssClass="button" OnClick="btnYeuCauThanhToan_Click"
                                        Text="Yêu cầu thanh toán" Visible="False" />
                                    <asp:Button ID="btnXoaPhieu" runat="server" CssClass="button" OnClick="btnXoaPhieu_Click"
                                        Text="Xóa phiếu đặt hàng" Visible="False" />
                                    <a href="OrderManager.aspx" class="button">Xem danh sách</a>
                                </div>
                                <div class="clear">
                                </div>
                                <!-- End Pagging -->
                            </td>
                        </tr>
                    </tfoot>
                    <tbody>
                        <tr>
                            <td align="center" valign="top">
                                <table style="width: 100%;" align="center">
                                <tbody style="border:none;">
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Mã phiếu hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:Label ID="MaPhieuDatHangLabel" runat="server" Text="MaPhieuDatHang"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đặt hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDatHangTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorNgayDatHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Thành tiền:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="ThanhTienTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorThanhTienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Phí vận chuyển:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="PhiVanChuyenTextBox" runat="server" Width="300px" 
                                                Enabled="False"></asp:TextBox>
                                            <div class="error-msg" id="ErrorPhiVanChuyenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Tình trạng:
                                        </td>
                                        <td style="text-align: left">
                                            <%--<asp:DropDownList ID="TinhTrangComboBox" runat="server" Width="300px" 
                                                Enabled="False">
                                            </asp:DropDownList>--%>
                                            <asp:TextBox ID="TinhTrangTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorTinhTrangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Khách hàng:
                                        </td>
                                        <td style="text-align: left">
                                            <%--<asp:DropDownList ID="KhachHangComboBox" runat="server" Width="300px" 
                                                Enabled="False">
                                            </asp:DropDownList>--%>
                                            <asp:TextBox ID="KhachHangTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorKhachHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Thành phố đến:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:DropDownList ID="ThanhPhoDenComboBox" runat="server" OnDataBound="ThanhPhoDenComboBox_DataBound"
                                                Width="300px" Enabled="False">
                                            </asp:DropDownList>
                                            <div class="error-msg" id="ErrorThanhPhoDenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Nhà vận chuyển:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:DropDownList ID="NhaVanChuyenComboBox" runat="server" Width="300px" 
                                                OnDataBound="NhaVanChuyenComboBox_DataBound" Enabled="False">
                                            </asp:DropDownList>
                                            <div class="error-msg" id="ErrorNhaVanChuyenTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đi dự kiến:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDiDuKienTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorNgayDiDuKienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Ngày đến dự kiến:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="NgayDenDuKienTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorNgayDenDuKienTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Liên kết theo dõi:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="LienKetTheoDoiTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorLienKetTheoDoiTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Địa chỉ:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DiaChiGiaoHangTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorDiaChiGiaoHangTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Địa chỉ thứ 2:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DiaChiGiaoHang2TextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorDiaChiGiaoHang2TextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Điện thoại di động:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DienThoaiDiDongTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorDienThoaiDiDongTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" style="text-align: right">
                                            Điện thoại bàn:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="DienThoaiBanTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorDienThoaiBanTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>
                                    <%--<tr>
                                        <td align="right" style="text-align: right">
                                            Mã bảo mật thẻ:
                                        </td>
                                        <td style="text-align: left">
                                            <asp:TextBox ID="MaBaoMatTheTextBox" runat="server" Width="300px" 
                                                Enabled="False" />
                                            <div class="error-msg" id="ErrorMaBaoMatTheTextBox" runat="server">
                                            </div>
                                        </td>
                                    </tr>--%>
                                </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <!-- End Tab Danh Sach-->
          
        </div>
        <!-- End .content-box-content -->
    </div>
    <div class="content-box">
        <!-- Start Content Box -->
        <div class="content-box-header">
            <h3>
                Chi tiết phiếu đặt hàng</h3>
            <div class="clear">
            </div>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <!-- Start Tab Danh Sach-->
            <div class="tab-content default-tab" id="Div1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <%
                    NhaKinhDoanhDataContext db = new NhaKinhDoanhDataContext();
                    int objId = 1;
                    if (Request.QueryString["id"] != null)
                        objId = Convert.ToInt32(Request.QueryString["id"].ToString());
                    var query = from ctp in db.CTPhieuDatHangs where ctp.MaPDH.Equals(objId) select ctp;
                    List<CTPhieuDatHang> lst = new List<CTPhieuDatHang>();
                    if (query.Count<CTPhieuDatHang>() > 0)
                    {
                        lst = query.ToList<CTPhieuDatHang>();
                    }
              
                %>
                <table align="center" width="100%">
                    <thead>
                        <tr>
                            <th>
                                STT
                            </th>
                            <th>
                                Tên
                            </th>
                            <th>
                                Giá bán
                            </th>
                            <th>
                                Số lượng
                            </th>
                            <th>
                                Đường dẫn
                            </th>
                            <th>
                                Loại tài liệu
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <% 
                            int stt = 0;
                            string tenLoaiTaiLieu = "Tài liệu cứng";
                            foreach (CTPhieuDatHang obj in lst)
                            {
                                stt++;
                                if (obj.LoaiSanPham == 1)
                                    tenLoaiTaiLieu = "Tài liệu mềm";
                        %>
                        <tr>
                            <td>
                                <%=string.Format("{0:000}",stt) %>
                            </td>
                            <td>
                                <%=MD5Hash.Trim(obj.TaiLieu.ProductName) %>
                            </td>
                            <td>
                                <%=obj.GiaBan %>
                            </td>
                            <td>
                                <%=obj.SoLuong %>
                            </td>
                            <td>
                                <%=obj.DuongDan%>
                            </td>
                            <td>
                                <%=tenLoaiTaiLieu%>
                            </td>
                        </tr>
                        <%}%>
                    </tbody>
                </table>
            </div>
        </div>
        <!-- End .content-box-content -->
    </div>
</asp:Content>
